.class public Les/lb;
.super Ljava/lang/Object;
.source "MediaEntityProvider.java"


# direct methods
.method public static a(Landroid/content/Context;Ljava/io/File;)Lcom/esfile/screen/recorder/provider/entity/a;
    .locals 6
    .annotation build Landroidx/annotation/Nullable;
    .end annotation

    .line 22
    invoke-virtual {p1}, Ljava/io/File;->exists()Z

    move-result v0

    if-nez v0, :cond_0

    const/4 p0, 0x0

    return-object p0

    .line 23
    :cond_0
    invoke-virtual {p1}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v0

    .line 24
    invoke-static {v0}, Les/nb;->c(Ljava/lang/String;)Lcom/esfile/screen/recorder/provider/entity/a;

    move-result-object v1

    if-eqz v1, :cond_1

    return-object v1

    .line 25
    :cond_1
    invoke-static {p0, v0}, Les/lb;->b(Landroid/content/Context;Ljava/lang/String;)Lcom/esfile/screen/recorder/provider/entity/a;

    move-result-object p0

    if-eqz p0, :cond_2

    .line 26
    invoke-virtual {p0}, Lcom/esfile/screen/recorder/provider/entity/a;->f()J

    move-result-wide v1

    const-wide/16 v3, 0x0

    cmp-long v5, v1, v3

    if-eqz v5, :cond_2

    .line 27
    invoke-virtual {p0}, Lcom/esfile/screen/recorder/provider/entity/a;->f()J

    move-result-wide p0

    goto :goto_0

    .line 28
    :cond_2
    invoke-virtual {p1}, Ljava/io/File;->lastModified()J

    move-result-wide p0

    const-wide/16 v1, 0x3e8

    div-long/2addr p0, v1

    .line 29
    :goto_0
    new-instance v1, Lcom/esfile/screen/recorder/provider/entity/a;

    invoke-direct {v1}, Lcom/esfile/screen/recorder/provider/entity/a;-><init>()V

    .line 30
    invoke-virtual {v1, v0}, Lcom/esfile/screen/recorder/provider/entity/a;->c(Ljava/lang/String;)V

    .line 31
    invoke-virtual {v1, p0, p1}, Lcom/esfile/screen/recorder/provider/entity/a;->b(J)V

    return-object v1
.end method

.method public static a(Landroid/content/Context;)Ljava/util/List;
    .locals 4
    .annotation build Landroidx/annotation/NonNull;
    .end annotation

    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/content/Context;",
            ")",
            "Ljava/util/List<",
            "Lcom/esfile/screen/recorder/provider/entity/a;",
            ">;"
        }
    .end annotation

    .line 1
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    .line 2
    invoke-static {}, Les/qc$e;->f()Ljava/util/List;

    move-result-object v1

    .line 3
    invoke-interface {v1}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :cond_0
    :goto_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-eqz v2, :cond_1

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/lang/String;

    .line 4
    invoke-static {v2}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v3

    if-nez v3, :cond_0

    .line 5
    invoke-static {p0, v2}, Les/lb;->a(Landroid/content/Context;Ljava/lang/String;)Ljava/util/List;

    move-result-object v2

    invoke-interface {v0, v2}, Ljava/util/List;->addAll(Ljava/util/Collection;)Z

    goto :goto_0

    .line 6
    :cond_1
    invoke-static {}, Les/qc$e;->a()Ljava/util/List;

    move-result-object v1

    .line 7
    invoke-interface {v1}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :cond_2
    :goto_1
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-eqz v2, :cond_3

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/lang/String;

    .line 8
    invoke-static {v2}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v3

    if-nez v3, :cond_2

    .line 9
    invoke-static {p0, v2}, Les/lb;->a(Landroid/content/Context;Ljava/lang/String;)Ljava/util/List;

    move-result-object v2

    invoke-interface {v0, v2}, Ljava/util/List;->addAll(Ljava/util/Collection;)Z

    goto :goto_1

    .line 10
    :cond_3
    invoke-static {}, Les/qc$e;->d()Ljava/util/List;

    move-result-object v1

    .line 11
    invoke-interface {v1}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :cond_4
    :goto_2
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-eqz v2, :cond_5

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/lang/String;

    .line 12
    invoke-static {v2}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v3

    if-nez v3, :cond_4

    .line 13
    invoke-static {p0, v2}, Les/lb;->a(Landroid/content/Context;Ljava/lang/String;)Ljava/util/List;

    move-result-object v2

    invoke-interface {v0, v2}, Ljava/util/List;->addAll(Ljava/util/Collection;)Z

    goto :goto_2

    :cond_5
    return-object v0
.end method

.method private static a(Landroid/content/Context;Ljava/lang/String;)Ljava/util/List;
    .locals 5
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/content/Context;",
            "Ljava/lang/String;",
            ")",
            "Ljava/util/List<",
            "Lcom/esfile/screen/recorder/provider/entity/a;",
            ">;"
        }
    .end annotation

    .line 14
    new-instance v0, Ljava/io/File;

    invoke-direct {v0, p1}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 15
    new-instance p1, Les/pb;

    const/4 v1, 0x1

    invoke-direct {p1, v1}, Les/pb;-><init>(I)V

    invoke-virtual {v0, p1}, Ljava/io/File;->listFiles(Ljava/io/FileFilter;)[Ljava/io/File;

    move-result-object p1

    .line 16
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    if-eqz p1, :cond_1

    .line 17
    array-length v1, p1

    if-lez v1, :cond_1

    .line 18
    array-length v1, p1

    const/4 v2, 0x0

    :goto_0
    if-ge v2, v1, :cond_1

    aget-object v3, p1, v2

    .line 19
    invoke-virtual {v3}, Ljava/io/File;->isFile()Z

    move-result v4

    if-eqz v4, :cond_0

    .line 20
    invoke-static {p0, v3}, Les/lb;->a(Landroid/content/Context;Ljava/io/File;)Lcom/esfile/screen/recorder/provider/entity/a;

    move-result-object v3

    if-eqz v3, :cond_0

    .line 21
    invoke-interface {v0, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    :cond_0
    add-int/lit8 v2, v2, 0x1

    goto :goto_0

    :cond_1
    return-object v0
.end method

.method public static b(Landroid/content/Context;Ljava/io/File;)Lcom/esfile/screen/recorder/provider/entity/a;
    .locals 7
    .annotation build Landroidx/annotation/Nullable;
    .end annotation

    .line 1
    invoke-virtual {p1}, Ljava/io/File;->exists()Z

    move-result v0

    if-nez v0, :cond_0

    const/4 p0, 0x0

    return-object p0

    .line 2
    :cond_0
    invoke-virtual {p1}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v0

    .line 3
    invoke-static {v0}, Les/nb;->c(Ljava/lang/String;)Lcom/esfile/screen/recorder/provider/entity/a;

    move-result-object v1

    if-eqz v1, :cond_1

    return-object v1

    .line 4
    :cond_1
    invoke-static {p0, v0}, Les/lb;->b(Landroid/content/Context;Ljava/lang/String;)Lcom/esfile/screen/recorder/provider/entity/a;

    move-result-object p0

    const-wide/16 v1, 0x0

    if-eqz p0, :cond_2

    .line 5
    invoke-virtual {p0}, Lcom/esfile/screen/recorder/provider/entity/a;->g()J

    move-result-wide v3

    .line 6
    invoke-virtual {p0}, Lcom/esfile/screen/recorder/provider/entity/a;->f()J

    move-result-wide v5

    goto :goto_0

    :cond_2
    move-wide v3, v1

    move-wide v5, v3

    :goto_0
    cmp-long p0, v5, v1

    if-nez p0, :cond_3

    .line 7
    invoke-virtual {p1}, Ljava/io/File;->lastModified()J

    move-result-wide p0

    const-wide/16 v5, 0x3e8

    div-long v5, p0, v5

    :cond_3
    cmp-long p0, v3, v1

    if-nez p0, :cond_4

    .line 8
    invoke-static {v0}, Lcom/esfile/screen/recorder/utils/i;->h(Ljava/lang/String;)J

    move-result-wide v3

    .line 9
    :cond_4
    new-instance p0, Lcom/esfile/screen/recorder/provider/entity/a;

    invoke-direct {p0}, Lcom/esfile/screen/recorder/provider/entity/a;-><init>()V

    .line 10
    invoke-virtual {p0, v0}, Lcom/esfile/screen/recorder/provider/entity/a;->c(Ljava/lang/String;)V

    .line 11
    invoke-virtual {p0, v5, v6}, Lcom/esfile/screen/recorder/provider/entity/a;->b(J)V

    .line 12
    invoke-virtual {p0, v3, v4}, Lcom/esfile/screen/recorder/provider/entity/a;->c(J)V

    return-object p0
.end method

.method private static b(Landroid/content/Context;Ljava/lang/String;)Lcom/esfile/screen/recorder/provider/entity/a;
    .locals 12

    .line 13
    invoke-virtual {p0}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object p0

    invoke-virtual {p0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    const/4 p0, 0x0

    if-nez v0, :cond_0

    return-object p0

    :cond_0
    const-string v1, "external"

    .line 14
    invoke-static {v1}, Landroid/provider/MediaStore$Files;->getContentUri(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v1

    const/4 v2, 0x1

    new-array v4, v2, [Ljava/lang/String;

    const/4 v3, 0x0

    aput-object p1, v4, v3

    const-string v6, ".png"

    .line 15
    invoke-virtual {p1, v6}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z

    move-result v5

    const-string v7, "duration"

    const-string v8, ".mp4"

    const-string v9, ".jpg"

    const-string v10, ".jpeg"

    const-string v11, "date_added"

    if-nez v5, :cond_3

    invoke-virtual {p1, v10}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z

    move-result v5

    if-nez v5, :cond_3

    invoke-virtual {p1, v9}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z

    move-result v5

    if-eqz v5, :cond_1

    goto :goto_0

    .line 16
    :cond_1
    invoke-virtual {p1, v8}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z

    move-result v5

    if-eqz v5, :cond_2

    .line 17
    sget-object v1, Landroid/provider/MediaStore$Video$Media;->EXTERNAL_CONTENT_URI:Landroid/net/Uri;

    const/4 v5, 0x2

    new-array v5, v5, [Ljava/lang/String;

    aput-object v11, v5, v3

    aput-object v7, v5, v2

    move-object v2, v5

    goto :goto_1

    :cond_2
    move-object v2, p0

    goto :goto_1

    .line 18
    :cond_3
    :goto_0
    sget-object v1, Landroid/provider/MediaStore$Images$Media;->EXTERNAL_CONTENT_URI:Landroid/net/Uri;

    new-array v2, v2, [Ljava/lang/String;

    aput-object v11, v2, v3

    :goto_1
    const/4 v5, 0x0

    const-string v3, "_data=?"

    .line 19
    invoke-virtual/range {v0 .. v5}, Landroid/content/ContentResolver;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v0

    if-nez v0, :cond_4

    return-object p0

    .line 20
    :cond_4
    new-instance p0, Lcom/esfile/screen/recorder/provider/entity/a;

    invoke-direct {p0}, Lcom/esfile/screen/recorder/provider/entity/a;-><init>()V

    .line 21
    invoke-interface {v0}, Landroid/database/Cursor;->moveToNext()Z

    move-result v1

    if-eqz v1, :cond_7

    .line 22
    invoke-virtual {p1, v6}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z

    move-result v1

    if-nez v1, :cond_6

    invoke-virtual {p1, v10}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z

    move-result v1

    if-nez v1, :cond_6

    invoke-virtual {p1, v9}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_5

    goto :goto_2

    .line 23
    :cond_5
    invoke-virtual {p1, v8}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z

    move-result p1

    if-eqz p1, :cond_7

    .line 24
    invoke-interface {v0, v11}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result p1

    invoke-interface {v0, p1}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v1

    .line 25
    invoke-interface {v0, v7}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result p1

    invoke-interface {v0, p1}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v3

    .line 26
    invoke-virtual {p0, v1, v2}, Lcom/esfile/screen/recorder/provider/entity/a;->b(J)V

    .line 27
    invoke-virtual {p0, v3, v4}, Lcom/esfile/screen/recorder/provider/entity/a;->c(J)V

    goto :goto_3

    .line 28
    :cond_6
    :goto_2
    invoke-interface {v0, v11}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result p1

    invoke-interface {v0, p1}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v1

    .line 29
    invoke-virtual {p0, v1, v2}, Lcom/esfile/screen/recorder/provider/entity/a;->b(J)V

    .line 30
    :cond_7
    :goto_3
    invoke-interface {v0}, Landroid/database/Cursor;->close()V

    return-object p0
.end method
